#include<iostream>

using namespace std;

const int maxn = 10000;
int num[maxn];

int len;

bool IsEven(int number) {
    return number % 2 == 0;
}

int count(int num[] , int left ,int right) {
    if(left == right) {
        if(IsEven(num[left])) {
            return 1;
        }else{
            return 0;
        }
    }

    int mid = (left + right) / 2;

    int total = 0;
    total += count(num , left , mid);
    total += count(num , mid + 1 , right);

    return total;
}

int main() {

    cout << "输入数组长度：" << endl;

    cin >> len;

    for(int i = 0 ;i < len ; i++){
        num[i] = rand();
    }

    cout << "数组为：" << endl;

    for(int i = 0 ;i < len ; i++){
        cout << num[i] << ' ';
    }

    int total = count(num , 0 , len - 1);

    cout << endl << "偶数个数为：" << total << endl;

    return 0;
}